<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="result"></div>

<script>
    if(typeof(EventSource)!=="undefined")
    {
        var source=new EventSource("http://127.0.0.1/data/demo/html5/web.php");
        source.onmessage=function(event) {
            document.getElementById("result").innerHTML+=event.data + "<br />";
        };
    }else{
        document.getElementById("result").innerHTML="Sorry, your browser does not support server-sent events...";
    }

</script>

</body>
</html>